<%-- 
    Document   : welcome
    Created on : Apr 14, 2012, 11:16:58 PM
    Author     : duongna
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
    <body>
        <c:import url="/header.jsp" />
        <c:import url="/leftbar.jsp"/>
        <div id="wrapper">
            <div id="content_wrapper"><span class="top"></span><span class="bottom"></span>
                <div id="content">
        <table border="1">
            <tr>
                <td>
                    <img src="${sessionScope.account.avatar}" height="200" width="200">
                </td>
                <td>
                    Username: ${sessionScope.account.username}<br>
                    Email Address: ${sessionScope.account.emailAddress}
                </td>
            </tr>
        </table>

        <%-- Recommend some appropriate people --%>
        <c:if test="${fn:length(searchResult) > 0}">
            <table border="1">
                <h2>Some people use may like</h2>
                <c:forEach var="acc" items="${searchResult}">
                    <tr>
                        <td>
                            <img src="${acc.avatar}" height="100" width="100">
                        </td>
                        <td>
                            <a href="
                               <c:url value="/ViewPersonalInfo">
                                   <c:param name="accountId" value="${acc.accountId}"/>
                               </c:url>
                               ">Username: ${acc.username}</a><br>
                            Age: ${acc.age}<br>
                            Gender: ${acc.gender}<br>
                            School: ${acc.career.school}<br>
                        </td>
                        <td>
                            Common Friend(s): ${acc.numOfCommonFriends}<br>
                            Match score: ${acc.matchScore}
                            PercentScore: ${acc.matchPercent}<br>
                            StarScore: ${acc.starScore}<br>
                        </td>
                        <td>
                            <form action="AddFriend">
                                <input type="submit" value="Add Friend">
                                <input type="hidden" name="targetId" value="${acc.accountId}">
                            </form>
                        </td>
                    </tr>
                </c:forEach>
            </table>
            <a href="/SearchMatch">More...</a>
        </c:if>

        <%-- rank new register accounts --%>

        <c:if test="${fn:length(rankNewResult) > 0}">
            <table border="1">
                <h2>System has some new people use may like</h2>
                <c:forEach var="acc" items="${rankNewResult}">
                    <tr>
                        <td>
                            <img src="${acc.avatar}" height="100" width="100">
                        </td>
                        <td>
                            <a href="
                               <c:url value="/ViewPersonalInfo">
                                   <c:param name="accountId" value="${acc.accountId}"/>
                               </c:url>
                               ">Username: ${acc.username}</a><br>
                            Age: ${acc.age}<br>
                            Gender: ${acc.gender}<br>
                            School: ${acc.career.school}
                        </td>
                        <td>
                            Common Friend(s): ${acc.numOfCommonFriends}<br>
                            Match score: ${acc.matchScore}
                            PercentScore: ${acc.matchPercent}<br>
                            StarScore: ${acc.starScore}<br>
                        </td>
                        <td>
                            <form action="AddFriend">
                                <input type="submit" value="Add Friend">
                                <input type="hidden" name="targetId" value="${acc.accountId}">
                            </form>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </c:if>
                </div> <!-- end of content -->

                <div id="sidebar">
                    <div class ="profile_box">
                        <a href="personal.jsp">
                            <h2 align="center">${account.username}</h2>
                        </a>
                        <a id="avatar" href="personal.jsp" >
                            <img src="images/shin.jpg" height="250" width="250"> 
                        </a>
                    </div>
                    <div class="news_box">
                        <a href="friends.jsp"> <h2 align="center">Friend list (${sessionScope.account.numOfFriends})</h2></a>
                        <table>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                </td>
                            </tr>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                </td>
                            </tr>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                </td>
                            </tr>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                </td>
                            </tr>
                            <tr>
                                <td width="80">
                                    <a href="">
                                        <img src="images/shin.jpg" height="70" width="70">
                                    </a>
                                </td>
                                <td valign="top">
                                    <a href="">Friend Name</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="cleaner"></div>  
                </div>

                <div class="cleaner"></div>
            </div>

            <div class="cleaner"></div>

        </div> <!-- end of content_wrapper -->

        <c:import url="/footer.jsp" />
    </body>
</html>
